home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / khexedit / zoominterface.h < prev   
Encoding:
C/C++ Source or Header  |  2005-09-10  |  2.5 KB  |  80 lines

  1. /***************************************************************************
  2.                           zoominterface.h  -  description
  3.                              -------------------
  4.     begin                : Fri Sep 12 2003
  5.     copyright            : (C) 2003 by Friedrich W. H. Kossebau
  6.     email                : Friedrich.W.H@Kossebau.de
  7.  ***************************************************************************/
  8.  
  9. /***************************************************************************
  10.  *                                                                         *
  11.  *   This library is free software; you can redistribute it and/or         *
  12.  *   modify it under the terms of the GNU Library General Public           *
  13.  *   License version 2 as published by the Free Software Foundation.       *
  14.  *                                                                         *
  15.  ***************************************************************************/
  16.  
  17.  
  18. #ifndef ZOOMINTERFACE_H
  19. #define ZOOMINTERFACE_H
  20.  
  21.  
  22. namespace KHE
  23. {
  24.  
  25. /**
  26.  * @short A simple interface for zooming
  27.  *
  28.  * This interface enables abstract linear zooming. 
  29.  * It operates in sizes of font point size.
  30.  *
  31.  * @author Friedrich W. H. Kossebau <Friedrich.W.H@Kossebau.de>
  32.  * @see createBytesEditWidget(), zoomInterface()
  33.  * @since 3.2
  34.  */
  35. class ZoomInterface
  36. {
  37.   public:
  38.     /** enlarges the display
  39.       * @param PointInc increment to the display size (in font point size)
  40.       */
  41.     virtual void zoomIn( int PointInc ) = 0;
  42.     /** increases the display size by an arbitrary value, usually 1 font point 
  43.       * @see zoomOut()
  44.       */
  45.     virtual void zoomIn() = 0;
  46.     /** makes the display smaller
  47.       * @param PointDec decrement to the display size (in font point size)
  48.       */
  49.     virtual void zoomOut( int PointDec ) = 0;
  50.     /** decreases the display size by an arbitrary value, usually 1 font point 
  51.       * @see zoomIn()
  52.       */
  53.     virtual void zoomOut() = 0;
  54.     /** sets the display size
  55.       * @param PointSize new display size (in font point size)
  56.       */
  57.     virtual void zoomTo( int PointSize ) = 0;
  58.     /** resets the display to the default size */
  59.     virtual void unZoom() = 0;
  60. };
  61.  
  62.  
  63. /** tries to get the zoom interface of t   
  64.   * @return a pointer to the interface, otherwise 0
  65.   * @author Friedrich W. H. Kossebau <Friedrich.W.H@Kossebau.de>
  66.   * @since 3.2
  67. */
  68. template<class T>
  69. ZoomInterface *zoomInterface( T *t )
  70. {
  71.   if( !t )
  72.     return 0;
  73.  
  74.   return static_cast<ZoomInterface*>( t->qt_cast("KHE::ZoomInterface") );
  75. }
  76.  
  77. }
  78.  
  79. #endif
  80.